package com.google.gwt.command.client;

import com.google.gwt.command.client.UndoEvent.UndoHandler;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;

public class UndoEvent extends GwtEvent<UndoHandler> {

	public interface UndoHandler extends EventHandler {

		void onUnDo(UndoEvent event);
	}

	private static Type<UndoHandler> TYPE;

	public static Type<UndoHandler> getType() {
		return TYPE != null ? TYPE : (TYPE = new Type<UndoHandler>());
	}

	public UndoEvent() {
	}

	public com.google.gwt.event.shared.GwtEvent.Type<UndoHandler> getAssociatedType() {
		return getType();
	}

	protected void dispatch(UndoHandler handler) {
		handler.onUnDo(this);
	}

}
